function [debt_overhang, equity_mv] = debtoverhang_fun(struct_input, firm_type)

RateSpec = struct_input.RateSpec;
StockSpec = struct_input.StockSpec;
OptSpec = struct_input.OptSpec;
Strike = struct_input.Strike;
Settle = struct_input.Settle;
Maturity = struct_input.Maturity;

if strcmp(firm_type, 'diverse')
    [equity_mv, equity_diverse_Delta] = basketsensbyju(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity, 'OutSpec', {'Price', 'Delta'}, 'UndIdx', 1);
    debt_overhang = 1 - equity_diverse_Delta;
elseif strcmp(firm_type, 'single')
    [equity_mv, equity_single_Delta] = optstocksensbybls(RateSpec, StockSpec, Settle, Maturity, OptSpec, Strike, 'OutSpec', {'Price', 'Delta'});
    debt_overhang = 1 - equity_single_Delta;
end